package week2.validator_ex;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class AuthenticatorFactory {
	 private static Properties prop = new Properties();
	    static {
	        try {
	            prop.load(new FileInputStream("src/week2/factory/op.properties"));
	        } catch (IOException e) {
	            e.printStackTrace();
	        }

    public static Authenticator createAuthenticator() {
    	KeyValueKeeper keeper=createKeyValueKeeper();
    	Encrypter encrypter = createEncrypter();
    	return new Suthenticator(keeper,encrypter),
    }

    }

    private static KeyValueKeeper createKeyValueKeeper() {
    	
    	KeyValueKeeper keeper=null;
    	try {
    	KeyValueKeeper keeper=class.forName(prop.getProperty(KeyValueKeeper)).newInstance();
       catch(Exception e) {
    	   e.printStackTrace();
       }
       return keeper;
    }

    private static Encrypter createEncrypter() {
    	
try {
	Encrypter keeper=(Encrypter)Class.forName(prop.getProperty(KeyValueKeeper)).newInstance();
}

    }
}
